<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>文件下载</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<%@include file="../include/include_jquery.jsp" %>
    <script type="text/javascript">
     $(function(){
    	 $("a").each(function(){
    		 $(this).attr("href",encodeURI(encodeURI( $(this).attr("href"))));
    	 });
    	 $("a").click(function(){
    		 var url = encodeURI(encodeURI($(this).attr("attr")+"&savename="+$("#saveName").val()+"&open="+$("#open").val()+"&name="+$("#fileDir").val()+"\/"+$("#fileName").val()));
    		 $(this).attr("href", url);
    		 $("#show").attr("src",url);
    	 });
    	 
     });
    </script>
  </head>
  
  <body>
  <center>
  		<div>下载</div>
  		目录：<input id="fileDir" value="lisheng">
  		文件：<input id="fileName" value="Penguins.jpg">
  		下载名称：<input id="saveName" value="">
  		是否打开：<input id="open" value="0"></br>
 	 <a href="javascript:void(0)"  attr="fileDown?1=1" target="_blank">down</a>
  	 <a href="javascript:void(0)" attr="fileDown?type=1" target="_blank">down1</a>
   	 <a href="javascript:void(0)" attr="fileDown?type=2" target="_blank">down2</a>
     <a href="javascript:void(0)" attr="fileDown?type=3" target="_blank">down3</a>
  		</br>
      <img id="show" alt="d" height="500px" width="500px" src="fileDown?type=1&name=lisheng/Penguins.jpg"/>
  
  </center>
  </body>
</html>
